<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="/struts-tags" prefix="s"%>
<html>
	<head>
		<title>查看所有用户信息</title>
		 <script type="text/javascript" src="<%=basePath%>/js/jquery-1.3.1.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/splitPage.css">
		<script type="text/javascript">
			$(function(){
				$("#page").change(function(){
					var page = $("#page").val();
					window.location.href="UserAction!getAllUser?page=" + page;
				});
				$("#keyWord").focus(function() {
					$("#keyWord").val("");
				}) ;
			});
		</script>
	</head>
	<body bgcolor="#D6DFF7">
		<table width="100%" border="0" align="center" cellpadding="1"
			cellspacing="0" class="" bgcolor="#DEE5FA">
			<tr>
				<td align="center">
					<form name="conditionForm" action="UserAction!getUsersByKeyWords"
						method="post">
						<table border="0" width="100%">
							<tr bgcolor="#799AE1" height="40">
								<td>
									<input id="keyWord" name="keyWord" type="text" value="请输入关键字"/>
									<input value="搜索" type="submit" />
								</td>
							</tr>
						</table>
					</form>
					<table cellspacing="1" cellpadding="4" width="100%" border="0">
						<tr>
							<td colspan="12" align="center">
								<blockquote>
									<font color="#874B46" size="4pt">用户信息</font>
								</blockquote>
							</td>
						</tr>

						<tr bgcolor="#799AE1" height="40">
							<td align="center" width="5%">
								用户ID
							</td>
							<td align="center" width="10%">
								用户昵称
							</td>
							<td align="center" width="8%">
								真实姓名
							</td>
							<td align="center" width="5%">
								性别
							</td>
							<td align="center" width="15%">
								注册时间
							</td>
							<td align="center" width="10%">
								电话
							</td>
							<td align="center" width="10%">
								地址
							</td>
							<td align="center" width="15%">
								邮箱
							</td>
							<td align="center" width="4%">
								等级
							</td>
							<td align="center" width="8%">
								修改
							</td>
							<td align="center" width="8%">
								删除
							</td>
						</tr>
						<s:if test="pageBean.list.size == 0">没有此记录！</s:if>
						<s:iterator value="pageBean.list">
							<tr height="30">
								<td align="center" width="5%">
									<s:property value="id" />
								</td>
								<td align="center" width="10%">
									<s:property value="userName" />
								</td>
								<td align="center" width="10%">
									<s:property value="trueName" />
								</td>
								<td align="center" width="5%">
									<s:property value="sex" />
								</td>
								<td align="center" width="15%">
									<s:property value="regDate" />
								</td>
								<td align="center" width="10%">
									<s:property value="tel" />
								</td>
								<td align="center" width="10%">
									<s:property value="address" />
								</td>
								<td align="center" width="15%">
									<s:property value="email" />
								</td>
								<td align="center" width="8%">
									<s:if test="rank == 1">管理员</s:if>
									<s:else>普通用户</s:else>
									
								</td>
								<td align="center" width="6%">
									<a
										href="UserAction!getUserInfoByUserId?user.id=<s:property value="id"/>">修改</a>
								</td>
								<td align="center" width="6%">
									<a
										href="UserAction!deleteUserById?user.id=<s:property value="id"/>">删除</a>
								</td>
							</tr>
						</s:iterator>
						<tr>
					</table>
					<tr height="25">
						<td align="center">
						<table width="100%" border="0">
							<tr>

								<td width="30%" align="left">
									共检索到
									<s:property value="pageBean.allRow" />
									条记录
								</td>
						<td align="right" id="pagelist">
						  <ul>
						  	<li>
						  		 <select name="page" id="page">
							  	<s:iterator value="pageBean.pageNumbers" status="pageNumbers">
								  	<s:iterator value="pageBean.pageNumbers[#pageNumbers.index]">
							  		<option value="<s:property/>"><s:property/></option>
								  	</s:iterator>
							  	</s:iterator>
							</select>
						  	</li>
						    <li class="pageinfo">共<s:property value="pageBean.totalPage" />页</li>
						    <li class="pageinfo">第<s:property value="pageBean.currentPage" />页</li>
						    <s:if test="%{pageBean.currentPage != pageBean.totalPage}">
								<li><a href="UserAction!getAllUser?page=<s:property value="pageBean.totalPage"/>">尾页</a></li>
								<li><a href="UserAction!getAllUser?page=<s:property value="%{pageBean.currentPage+1}"/>">下一页</a></li>
							</s:if>
						  	<s:if test="%{pageBean.currentPage == 1}"></s:if>
						  	<s:else>
								<li><a href="UserAction!getAllUser?page=<s:property value="%{pageBean.currentPage-1}"/>">上一页</a></li>
								<li><a href="UserAction!getAllUser?page=1">首页</a></li>
							</s:else>
						  </ul>
					</td>
								</tr>
							</table>
					</tr>
		</table>
		</table>
	</body>
</html>
